<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root"></div> 
</body>
<script src="../react@18.js"></script>
<script src="../react-dom@18.js"></script>
<script>
    console.log(React)
    // 创建虚拟dom
    let h1 = React.createElement("h1",null,"学习使我快乐");
    // ReactDOM.render(h1,document.getElementById("root"))
    console.log(ReactDOM)
    //创建跟容器
    let root  = ReactDOM.createRoot(document.getElementById("root"));
    console.log(root)
    // 将虚拟dom转化为真实dom渲染到页面
    root.render(h1)
    
</script>
</html>